let caseAssociation = require('./caseAssociation/index');//案件关联
let selectingArbitrators = require('./selectingArbitrators/index');//选择仲裁员
let confirmArbitrators = require('./confirmArbitrators/index');//确认仲裁员
let caseFile = require('../component/caseFile');//读写案件信息

/**
 * 庭前模块脚本
 * @param pupConfig 基础配置信息
 * @returns {caseId: string, secretaryId: string} 案件信息：caseId是案件ID，secretaryId为秘书账号
 */
const start = async (pupConfig, caseInfo) => {
    caseInfo = await caseFile.read(caseInfo);
    await caseAssociation(pupConfig, caseInfo);
    await selectingArbitrators(pupConfig, caseInfo);
    await confirmArbitrators(pupConfig, caseInfo);
    caseInfo = await caseFile.write(caseInfo);
    return caseInfo
}

module.exports = start;
